using System;
using System.Web.UI;
using SCRUMPoker.Web;

namespace SCRUMPoker
{
    public class DefaultPresenter : PresenterBase<IDefaultView>
    {
        private ISession _Session;
        public DefaultPresenter(IDefaultView view, ISession session) 
            : base(view)
        {
            _Session = session;
        }

        protected override void Init(bool isPostBack)
        {
            View.CreateUser += OnCreateUser;
        }

        public void OnCreateUser(object sender, EventArgs e)
        {
            Participant part = new Participant();
            part.Name = View.Username;
            _Session.GameParticipant = part;
        }
    }
}
